
                <!DOCTYPE html>
                <html lang="zh">
                <head>
                  <meta charset="UTF-8">
                  <meta name="viewport" content="width=device-width, initial-scale=1.0">
                  <title>创建学习计划</title>
                  <style>
                    *,
                    *::before,
                    *::after {
                      box-sizing: border-box;
                      margin: 0;
                    }
                    .iframe-outer {
                      position: fixed;
                      top: 0;
                      left: 0;
                      bottom: 0;
                      right: 0;
                      display: flex;
                      justify-content: center;
                      background-color: #E0E0E0;
                    }
                    .iframe-wrapper {
                      width: 100%;
                      height: 100%;
                      margin: 0 auto;
                      transform-origin: center top;
                      flex-shrink: 0;
                    }
                    #dynamicIframe {
                      border: none;
                      width: 100%;
                      height: 100%;
                    }
                  </style>
                  <script>
                const width = 402
                const height = 874
                const resolutionRatio = width && height ? width / height : 1
                const pageNameMap = {
                  'splash_page': '启动页',
    'login_page': '登录页',
    'register_page': '注册页',
    'forgot_password_page': '忘记密码页',
    'main_account_home_page': '主账户首页',
    'associated_account_home_page': '关联账户首页',
    'personal_settings_page': '个人设置',
    'edit_profile_page': '编辑个人信息页',
    'change_password_page': '修改密码页',
    'account_management_page': '账户管理',
    'associated_account_detail_page': '关联账户详情',
    'edit_associated_account_page': '编辑关联账户页',
    'create_associated_account_page': '新建关联账户',
    'goal_list_page': '目标列表',
    'create_learning_goal_page': '创建学习目标',
    'create_life_goal_page': '创建生活目标',
    'learning_goal_detail_page': '学习目标详情',
    'edit_learning_goal_page': '编辑学习目标页',
    'life_goal_detail_page': '生活目标详情',
    'edit_life_goal_page': '编辑生活目标页',
    'plan_list_page': '计划列表',
    'create_study_plan_page': '创建学习计划',
    'study_plan_detail_page': '学习计划详情',
    'edit_study_plan_page': '编辑学习计划页',
    'goals_plans_dashboard_page': '目标计划看板',
    'comment_share_page': '点评分享页',
    'reward_management_page': '奖励管理',
    'my_plans_goals_page': '我的计划与目标',
    'wish_pool_page': '许愿池',
    'create_wish_page': '创建愿望页',
    'wish_detail_page': '愿望详情页',
    'points_level_title_page': '积分等级称号',
    'reward_history_page': '积分历史页',
    'notification_center_page': '通知中心'
                }
                function setIframeSize(w, h) {
                  const currentContainerRadio = w / h
                  let widthValue = w
                  let heightValue = h
                  let zoom = 1
                  if (currentContainerRadio > resolutionRatio) {
                    widthValue = h * resolutionRatio
                    heightValue = h
                  } else {
                    widthValue = w
                    heightValue = w / resolutionRatio
                  }
                  zoom = width ? widthValue / width : 1
                  return {
                    width: widthValue / zoom + 'px',
                    height: heightValue / zoom + 'px',
                    zoom,
                  }
                }
                function adjustIframeSize() {
                  const iframeWrapper = document.querySelector(".iframe-wrapper")
                  const { width, height, zoom } = setIframeSize(window.innerWidth, window.innerHeight)
                  iframeWrapper.style.height = height
                  iframeWrapper.style.width = width
                  iframeWrapper.style.transform = 'scale(' + zoom + ')'
                }
                function sanitizeFilename(name) {
                  return name.replace(/[\/:*?"<>|]/g, '_')
                }
                function handlePostMessage(event) {
                  if (!event.data) {
                    return
                  }
                  const { type, targetPageId } = event.data
                  const targetPageName = pageNameMap[targetPageId]
                  if (type === "iframeNavigation" && targetPageId && targetPageName) {
                    window.location.href = targetPageName + '.html'
                  }
                }
                window.addEventListener('message', handlePostMessage)
                window.onload = adjustIframeSize
                window.onresize = adjustIframeSize
                window.onunload = () => {
                  window.removeEventListener('message', handlePostMessage)
                }
              </script>
                </head>
                <body>
                  <div class="iframe-outer">
                    <div class="iframe-wrapper">
                      <iframe id="dynamicIframe" srcdoc='<html lang="zh" data-theme="business"><head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>创建学习计划</title>
    <link href="./assets/static/uxbot/daisyui@5.css" rel="stylesheet" type="text/css">
    <script src="./assets/static/uxbot/tailwind-browser@4.js"></script>
    <link href="./assets/static/uxbot/daisyui-themes.css" rel="stylesheet" type="text/css">
    <script src="./assets/3/3.1.1/iconify.min.js"></script>
    <style>
/* DaisyUI Theme Variables Customization for Learning Assistant App */
/* Based on the business theme with Material Design Dark Theme grey levels */
:root {
    /* 学习助手主题色彩定制 */
    --color-primary: rgba(59, 130, 246, 1); /* 学习主题蓝色 */
    --color-primary-content: rgba(255, 255, 255, 1);
    --color-secondary: rgba(99, 102, 241, 1); /* 辅助紫色 */
    --color-secondary-content: rgba(255, 255, 255, 1);
    --color-accent: rgba(34, 197, 94, 1); /* 成功绿色 */
    --color-accent-content: rgba(255, 255, 255, 1);
    --color-success: rgba(34, 197, 94, 1);
    --color-warning: rgba(251, 191, 36, 1);
    --color-error: rgba(239, 68, 68, 1);
    --color-info: rgba(59, 130, 246, 1);
    --color-base-100: rgba(38, 38, 38, 1); /* Material Design 深灰 */
    --color-base-200: rgba(30, 30, 30, 1);
    --color-base-300: rgba(23, 23, 23, 1);
    --color-base-content: rgba(248, 248, 248, 1);
    --radius-box: 0.75rem;
    --radius-field: 0.5rem;
}

/* 移动端安全区域适配 */
.safe-area-top {
    padding-top: env(safe-area-inset-top, 24px);
}

.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom, 80px);
}

/* 底部导航栏样式 */
.bottom-dock {
    height: 64px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 顶部导航栏样式 */
.top-navbar {
    height: 56px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 触摸目标最小尺寸 */
.touch-target {
    min-width: 44px;
    min-height: 44px;
}

/* 卡片样式 */
.learning-card {
    border-radius: var(--radius-box);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 动画过渡 */
.smooth-transition {
    transition: all 0.2s ease-in-out;
}

/* 积分等级样式 */
.points-badge {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: var(--color-primary-content);
    border-radius: var(--radius-field);
}

/* 目标完成度进度条 */
.goal-progress {
    height: 8px;
    border-radius: 4px;
    background: var(--color-base-200);
    overflow: hidden;
}

.goal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-success), var(--color-accent));
    transition: width 0.3s ease-in-out;
}

/* 任务提醒面板 */
.task-reminder-panel {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.3s ease-in-out;
}

.task-reminder-panel.hidden {
    transform: translateY(100%);
}
</style> <style>
/* 为深色主题下的日期和时间选择器图标提供更好的可见性 */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(0.8);
    cursor: pointer;
}

/* 确保主内容区域不会被固定头部和尾部遮挡 */
body {
    padding-top: 56px; /* 匹配 top-navbar 高度 */
    padding-bottom: 88px; /* 匹配 ConfirmAction 高度 */
}

/* 主内容区域使用自己的滚动条 */
main {
    height: calc(100vh - 56px - 88px);
    overflow-y: auto;
    /* 恢复body上的内边距 */
    margin-top: -56px;
    margin-bottom: -88px;
}

/* 底部操作栏安全区域适配 */
#ConfirmAction.safe-area-bottom {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

/* 任务卡片添加动画 */
.task-block {
    animation: slide-in-up 0.3s ease-out forwards;
}

@keyframes slide-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
</style>
  <script src="./assets/static/uxbot/25_6/holder.js"></script></head>
  <body class="bg-base-300">
    <div data-section-id="common_top_navbar" data-section-type="common_header">
    <div class="fixed top-0 left-0 right-0 z-50 bg-base-300/95 top-navbar border-b border-base-content/10 safe-area-top">
        <div class="flex items-center justify-between px-4 h-14">
            <!-- 左侧导航按钮 -->
            <button class="btn btn-ghost btn-sm touch-target" onclick="handleBackNavigation()">
                <span class="iconify" data-icon="heroicons:arrow-left" data-width="24"></span>
            </button>
            
            <!-- 中间标题 -->
            <h1 class="text-lg font-semibold truncate flex-1 text-center px-4 navbar-title">学习助手</h1>
            
            <!-- 右侧操作按钮 -->
            <div class="flex items-center space-x-2 navbar-actions">
                <button class="btn btn-ghost btn-sm touch-target hidden" data-action="notifications" onclick="navigateTo(&#39;notification_center_page&#39;)">
                    <div class="indicator">
                        <span class="indicator-item badge badge-error badge-xs notification-badge hidden"></span>
                        <span class="iconify" data-icon="heroicons:bell" data-width="24"></span>
                    </div>
                </button>
                
                <button class="btn btn-ghost btn-sm touch-target hidden" data-action="search">
                    <span class="iconify" data-icon="heroicons:magnifying-glass" data-width="24"></span>
                </button>
                
                <button class="btn btn-ghost btn-sm touch-target hidden" data-action="more">
                    <span class="iconify" data-icon="heroicons:ellipsis-horizontal" data-width="24"></span>
                </button>
            </div>
        </div>
    </div>
</div>

<style>
[data-section-id="common_top_navbar"] .navbar-title {
    color: var(--color-base-content);
}

[data-section-id="common_top_navbar"] .notification-badge {
    animation: pulse 2s infinite;
}
</style>

<script>
(function() {
    // 顶部导航栏配置函数
    window.configTopNavbar = function(options = {}) {
        const navbar = document.querySelector(&#39;[data-section-id="common_top_navbar"]&#39;);
        if (!navbar) return;

        const title = navbar.querySelector(&#39;.navbar-title&#39;);
        const backBtn = navbar.querySelector(&#39;button[onclick*="handleBackNavigation"]&#39;);
        const notificationBtn = navbar.querySelector(&#39;[data-action="notifications"]&#39;);
        const searchBtn = navbar.querySelector(&#39;[data-action="search"]&#39;);
        const moreBtn = navbar.querySelector(&#39;[data-action="more"]&#39;);

        // 设置标题
        if (options.title) {
            title.textContent = options.title;
        }

        // 显示/隐藏返回按钮
        if (options.showBack !== undefined) {
            backBtn.style.display = options.showBack ? &#39;flex&#39; : &#39;none&#39;;
        }

        // 配置通知按钮
        if (options.showNotifications !== undefined) {
            notificationBtn.classList.toggle(&#39;hidden&#39;, !options.showNotifications);
        }

        // 配置搜索按钮
        if (options.showSearch) {
            searchBtn.classList.remove(&#39;hidden&#39;);
            searchBtn.onclick = options.searchAction || (() => {});
        } else if (options.showSearch === false) {
            searchBtn.classList.add(&#39;hidden&#39;);
        }

        // 配置更多按钮
        if (options.showMore) {
            moreBtn.classList.remove(&#39;hidden&#39;);
            moreBtn.onclick = options.moreAction || (() => {});
        } else if (options.showMore === false) {
            moreBtn.classList.add(&#39;hidden&#39;);
        }

        // 显示/隐藏整个导航栏
        if (options.show !== undefined) {
            navbar.style.display = options.show ? &#39;block&#39; : &#39;none&#39;;
        }
    };

    // 更新通知徽章
    window.updateNotificationBadge = function(count) {
        const badge = document.querySelector(&#39;[data-section-id="common_top_navbar"] .notification-badge&#39;);
        if (badge) {
            if (count > 0) {
                badge.classList.remove(&#39;hidden&#39;);
                badge.textContent = count > 99 ? &#39;99+&#39; : count.toString();
            } else {
                badge.classList.add(&#39;hidden&#39;);
            }
        }
    };

    // 隐藏导航栏函数
    window.hideTopNavbar = function() {
        const navbar = document.querySelector(&#39;[data-section-id="common_top_navbar"]&#39;);
        if (navbar) {
            navbar.style.display = &#39;none&#39;;
        }
    };

    // 显示导航栏函数
    window.showTopNavbar = function() {
        const navbar = document.querySelector(&#39;[data-section-id="common_top_navbar"]&#39;);
        if (navbar) {
            navbar.style.display = &#39;block&#39;;
        }
    };
})();
</script><div data-section-id="common_toast" data-section-type="common_section">
    <div id="global-toast-container" class="toast toast-top toast-center z-50">
        <!-- Toast消息将动态插入到这里 -->
    </div>
</div>

<style>
[data-section-id="common_toast"] .toast {
    padding-top: env(safe-area-inset-top, 24px);
}

[data-section-id="common_toast"] .alert {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-field);
}
</style>

<script>
(function() {
    // Toast功能已在common_script中定义
})();
</script><div data-section-id="common_modal" data-section-type="common_section">
    <dialog id="global-modal" class="modal">
        <div class="modal-box bg-base-200">
            <h3 class="font-bold text-lg modal-title">提示</h3>
            <div class="py-4 modal-content">
                <!-- 弹窗内容将动态插入到这里 -->
            </div>
            <div class="modal-action modal-actions">
                <button class="btn" onclick="document.getElementById(&#39;global-modal&#39;).close()">
                    关闭
                </button>
            </div>
        </div>
        <form method="dialog" class="modal-backdrop">
            <button>close</button>
        </form>
    </dialog>
</div>

<style>
[data-section-id="common_modal"] .modal-box {
    border-radius: var(--radius-box);
    border: 1px solid var(--color-base-content)/10;
}
</style>

<script>
(function() {
    // Modal功能已在common_script中定义
})();
</script><div data-section-id="common_task_reminder" data-section-type="common_section">
    <div class="fixed bottom-16 left-0 right-0 z-30 bg-base-200/95 task-reminder-panel border-t border-base-content/10 hidden">
        <div class="flex items-center p-4">
            <!-- 任务图标 -->
            <div class="flex-shrink-0 w-12 h-12 bg-primary/20 rounded-full flex items-center justify-center">
                <span class="iconify text-primary" data-icon="heroicons:clock" data-width="24"></span>
            </div>
            
            <!-- 任务信息 -->
            <div class="flex-1 mx-3 min-w-0">
                <p class="text-sm font-medium truncate task-title">即将开始任务</p>
                <div class="flex items-center gap-2 text-xs text-base-content/70">
                    <span class="task-subject">数学</span>
                    <span>·</span>
                    <span class="task-time">14:00 - 15:00</span>
                </div>
            </div>
            
            <!-- 操作按钮 -->
            <div class="flex items-center space-x-2 flex-shrink-0">
                <button class="btn btn-ghost btn-sm btn-circle touch-target" onclick="taskReminderControl.hide()">
                    <span class="iconify" data-icon="heroicons:x-mark" data-width="16"></span>
                </button>
                
                <button class="btn btn-primary btn-sm" onclick="navigateTo(&#39;my_plans_goals_page&#39;)">
                    查看详情
                </button>
            </div>
        </div>
    </div>
</div>

<style>
[data-section-id="common_task_reminder"] .task-reminder-panel:hover {
    background-color: rgba(var(--color-base-200), 1);
}
</style>

<script>
(function() {
    // 任务提醒面板功能已在common_script中定义
    
    // 模拟AI助手任务提醒
    window.simulateTaskReminder = function() {
        const sampleTasks = [
            { title: &#39;数学作业练习&#39;, subject: &#39;数学&#39;, time: &#39;14:00 - 15:00&#39; },
            { title: &#39;英语单词背诵&#39;, subject: &#39;英语&#39;, time: &#39;16:00 - 16:30&#39; },
            { title: &#39;阅读理解训练&#39;, subject: &#39;语文&#39;, time: &#39;19:00 - 19:45&#39; }
        ];
        
        const randomTask = sampleTasks[Math.floor(Math.random() * sampleTasks.length)];
        taskReminderControl.show(randomTask);
        
        // 5秒后自动隐藏
        setTimeout(() => {
            taskReminderControl.hide();
        }, 5000);
    };
})();
</script>
    <main id="StudyPlanForm" class="pt-20 pb-28 px-4">
      <div class="space-y-6">
        <!-- 关联账户与生效日期 -->
        <div class="card bg-base-100 shadow-lg">
          <div class="card-body p-4 space-y-4">
            <div class="form-control w-full">
              <label class="label"><span class="label-text text-base-content">选择关联账户</span></label><select class="select select-bordered w-full bg-base-200">
                <option>小明</option>
                <option>小红</option>
              </select>
            </div>
            <div class="form-control w-full">
              <label class="label"><span class="label-text text-base-content">计划生效日期</span></label><label class="input input-bordered flex items-center gap-2 bg-base-200"><span class="iconify text-base-content/70" data-icon="heroicons:calendar-days"></span><input type="date" id="effective-date" placeholder="选择日期" class="grow bg-transparent"></label>
            </div>
          </div>
        </div>
        <!-- 任务列表容器 -->
        <div id="tasks-container" class="space-y-4">
          <!-- 任务模板，JS会克隆此结构 -->
          <div data-repeatable="true" class="card bg-base-100 shadow-lg task-block transition-transform duration-200 ease-in-out">
            <div class="card-body p-4">
              <div class="flex justify-between items-center mb-2">
                <h3 class="font-bold text-base-content task-title">任务 1</h3>
                <button class="btn btn-ghost btn-sm btn-circle" onclick="deleteTask(this)">
                  <span class="iconify text-error" data-icon="heroicons:trash" data-width="20"></span>
                </button>
              </div>
              <div class="space-y-4">
                <div class="form-control w-full">
                  <label class="label"><span class="label-text text-base-content/80">科目类型</span></label><select class="select select-bordered w-full bg-base-200 i7lr39 spark-custom-i7lr39" id="i7lr39">
                    <option disabled="" selected="">请选择科目</option>
                    <option>语文</option>
                    <option>数学</option>
                    <option>英语</option>
                    <option>物理</option>
                    <option>自定义</option>
                  </select>
                </div>
                <div class="form-control w-full">
                  <label class="label"><span class="label-text text-base-content/80">具体任务</span></label><textarea placeholder="例如：完成《xxx》第一章节练习" class="textarea textarea-bordered h-24 bg-base-200"></textarea>
                </div>
                <div class="grid grid-cols-2 gap-4">
                  <div class="form-control">
                    <label class="label"><span class="label-text text-base-content/80">开始时间</span></label><label class="input input-bordered flex items-center gap-2 bg-base-200"><span class="iconify text-base-content/70" data-icon="heroicons:clock"></span><input type="time" class="grow bg-transparent"></label>
                  </div>
                  <div class="form-control">
                    <label class="label"><span class="label-text text-base-content/80">结束时间</span></label><label class="input input-bordered flex items-center gap-2 bg-base-200"><span class="iconify text-base-content/70" data-icon="heroicons:clock"></span><input type="time" class="grow bg-transparent"></label>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <!-- 添加任务按钮 --><button class="btn btn-outline btn-primary w-full smooth-transition active:scale-95" onclick="addTask()">
          <span class="iconify" data-icon="heroicons:plus-circle" data-width="20"></span>
          添加任务
        </button>
      </div>
    </main>
    <footer id="ConfirmAction" class="fixed bottom-0 left-0 right-0 z-40 bg-base-300/95 border-t border-base-content/10 safe-area-bottom backdrop-blur-sm">
      <div class="p-4">
        <button class="btn btn-primary w-full text-base font-bold h-12 smooth-transition active:scale-95" onclick="handleSavePlan()">
          保存计划
        </button>
      </div>
    </footer>
    <script>
(function() {
    // 全局命名空间
    window.APP_GLOBALS = window.APP_GLOBALS || {};
    
    // 全局导航函数
    window.navigateTo = function(targetPageId) {
        const isInIframe = window.self !== window.top;
        const targetFileName = `${targetPageId}.html`;
        
        if (isInIframe) {
            window.parent.postMessage({
                type: &#39;iframeNavigation&#39;,
                targetPageId: targetPageId
            }, &#39;*&#39;);
        } else {
            window.location.href = targetFileName;
        }
    };

    // 全局Toast通知系统
    window.showToast = function(message, type = &#39;info&#39;, duration = 3000) {
        const toastContainer = document.getElementById(&#39;global-toast-container&#39;);
        if (!toastContainer) return;

        const toast = document.createElement(&#39;div&#39;);
        toast.className = `alert alert-${type} shadow-lg`;
        
        const iconMap = {
            &#39;info&#39;: &#39;heroicons:information-circle&#39;,
            &#39;success&#39;: &#39;heroicons:check-circle&#39;,
            &#39;warning&#39;: &#39;heroicons:exclamation-triangle&#39;,
            &#39;error&#39;: &#39;heroicons:x-circle&#39;
        };
        
        toast.innerHTML = `
            <span class="iconify" data-icon="${iconMap[type] || iconMap.info}" data-width="20"></span>
            <span>${message}</span>
        `;
        
        toastContainer.appendChild(toast);

        // 自动移除
        setTimeout(() => {
            if (toast.parentNode) {
                toast.parentNode.removeChild(toast);
            }
        }, duration);
    };

    // 全局Modal系统
    window.showModal = function(title, content, buttons = []) {
        const modal = document.getElementById(&#39;global-modal&#39;);
        const modalTitle = modal.querySelector(&#39;.modal-title&#39;);
        const modalContent = modal.querySelector(&#39;.modal-content&#39;);
        const modalActions = modal.querySelector(&#39;.modal-actions&#39;);

        modalTitle.textContent = title;
        modalContent.innerHTML = content;

        // 清空并设置按钮
        modalActions.innerHTML = &#39;&#39;;
        buttons.forEach(button => {
            const btn = document.createElement(&#39;button&#39;);
            btn.className = `btn ${button.class || &#39;btn-primary&#39;}`;
            btn.textContent = button.text;
            btn.onclick = button.action || (() => modal.close());
            modalActions.appendChild(btn);
        });

        modal.showModal();
    };

    // 任务提醒面板控制
    window.taskReminderControl = {
        show: function(taskInfo) {
            const panel = document.querySelector(&#39;[data-section-id="common_task_reminder"]&#39;);
            if (panel) {
                panel.classList.remove(&#39;hidden&#39;);
                this.updateTask(taskInfo);
            }
        },
        hide: function() {
            const panel = document.querySelector(&#39;[data-section-id="common_task_reminder"]&#39;);
            if (panel) {
                panel.classList.add(&#39;hidden&#39;);
            }
        },
        updateTask: function(taskInfo) {
            const panel = document.querySelector(&#39;[data-section-id="common_task_reminder"]&#39;);
            if (panel &amp;&amp; taskInfo) {
                const titleEl = panel.querySelector(&#39;.task-title&#39;);
                const timeEl = panel.querySelector(&#39;.task-time&#39;);
                const subjectEl = panel.querySelector(&#39;.task-subject&#39;);
                
                if (titleEl) titleEl.textContent = taskInfo.title || &#39;即将开始任务&#39;;
                if (timeEl) timeEl.textContent = taskInfo.time || &#39;&#39;;
                if (subjectEl) subjectEl.textContent = taskInfo.subject || &#39;&#39;;
            }
        }
    };

    // 底部导航激活状态
    window.setActiveNavItem = function(pageId) {
        const navItems = document.querySelectorAll(&#39;[data-section-id="common_bottom_dock"] .dock-item&#39;);
        navItems.forEach(item => {
            item.classList.remove(&#39;text-primary&#39;, &#39;bg-primary/10&#39;);
            item.classList.add(&#39;text-base-content&#39;);
        });

        // 页面与导航项映射
        const navMapping = {
            &#39;main_account_home_page&#39;: &#39;home&#39;,
            &#39;associated_account_home_page&#39;: &#39;home&#39;,
            &#39;goal_list_page&#39;: &#39;goals&#39;,
            &#39;create_learning_goal_page&#39;: &#39;goals&#39;,
            &#39;create_life_goal_page&#39;: &#39;goals&#39;,
            &#39;plan_list_page&#39;: &#39;plans&#39;,
            &#39;create_study_plan_page&#39;: &#39;plans&#39;,
            &#39;goals_plans_dashboard_page&#39;: &#39;dashboard&#39;,
            &#39;points_level_title_page&#39;: &#39;points&#39;,
            &#39;reward_management_page&#39;: &#39;points&#39;,
            &#39;personal_settings_page&#39;: &#39;profile&#39;,
            &#39;account_management_page&#39;: &#39;profile&#39;
        };

        const activeNavId = navMapping[pageId];
        if (activeNavId) {
            const activeItem = document.querySelector(`[data-nav-id="${activeNavId}"]`);
            if (activeItem) {
                activeItem.classList.remove(&#39;text-base-content&#39;);
                activeItem.classList.add(&#39;text-primary&#39;, &#39;bg-primary/10&#39;);
            }
        }
    };

    // 用户类型检测 (可以根据实际登录状态来判断)
    window.getUserType = function() {
        // 这里应该根据实际的用户登录状态来判断
        // 暂时返回主账户类型作为默认值
        return APP_GLOBALS.userType || &#39;main_account&#39;;
    };

    // 积分更新函数
    window.updatePoints = function(points, level, title) {
        APP_GLOBALS.userPoints = points;
        APP_GLOBALS.userLevel = level;
        APP_GLOBALS.userTitle = title;
        
        // 更新页面中的积分显示
        const pointsElements = document.querySelectorAll(&#39;.user-points&#39;);
        pointsElements.forEach(el => {
            el.textContent = points;
        });
    };

    // 返回上一页函数
    window.handleBackNavigation = function() {
        if (window.history.length > 1) {
            window.history.back();
        } else {
            // 如果没有历史记录，根据用户类型跳转到对应首页
            const userType = getUserType();
            if (userType === &#39;main_account&#39;) {
                navigateTo(&#39;main_account_home_page&#39;);
            } else {
                navigateTo(&#39;associated_account_home_page&#39;);
            }
        }
    };
})();
</script><script>
document.addEventListener(&#39;DOMContentLoaded&#39;, function() {
    // 配置顶部导航栏
    if (window.configTopNavbar) {
        window.configTopNavbar({
            title: &#39;创建学习计划&#39;,
            showBack: true
        });
    }

    // 设置生效日期默认为今天
    const dateInput = document.getElementById(&#39;effective-date&#39;);
    if (dateInput) {
        const today = new Date();
        const yyyy = today.getFullYear();
        const mm = String(today.getMonth() + 1).padStart(2, &#39;0&#39;); // Months are 0-11
        const dd = String(today.getDate()).padStart(2, &#39;0&#39;);
        dateInput.value = `${yyyy}-${mm}-${dd}`;
    }
});

function renumberTasks() {
    const tasksContainer = document.getElementById(&#39;tasks-container&#39;);
    const taskBlocks = tasksContainer.querySelectorAll(&#39;.task-block&#39;);
    taskBlocks.forEach((task, index) => {
        const title = task.querySelector(&#39;.task-title&#39;);
        if (title) {
            title.textContent = `任务 ${index + 1}`;
        }
    });
}

function addTask() {
    const tasksContainer = document.getElementById(&#39;tasks-container&#39;);
    const firstTask = tasksContainer.querySelector(&#39;.task-block&#39;);
    if (!firstTask) {
        // 如果没有任务模板，则不执行任何操作
        console.error("任务模板未找到!");
        return;
    }

    const newTask = firstTask.cloneNode(true);

    // 清空新任务中的输入值
    newTask.querySelectorAll(&#39;input, textarea&#39;).forEach(input => {
        if (input.type !== &#39;radio&#39; &amp;&amp; input.type !== &#39;checkbox&#39;) {
            input.value = &#39;&#39;;
        }
    });
    newTask.querySelectorAll(&#39;select&#39;).forEach(select => {
        select.selectedIndex = 0;
    });

    tasksContainer.appendChild(newTask);
    renumberTasks();
    
    // 平滑滚动到新添加的任务
    newTask.scrollIntoView({ behavior: &#39;smooth&#39;, block: &#39;end&#39; });
    
    // 显示成功的轻提示
    if(window.showToast) {
        showToast(&#39;新任务已添加&#39;, &#39;success&#39;);
    }
}

function deleteTask(deleteButton) {
    const taskToDelete = deleteButton.closest(&#39;.task-block&#39;);
    const tasksContainer = document.getElementById(&#39;tasks-container&#39;);
    const taskBlocks = tasksContainer.querySelectorAll(&#39;.task-block&#39;);

    if (taskBlocks.length <= 1) {
        if(window.showToast) {
            showToast(&#39;至少需要保留一个任务&#39;, &#39;warning&#39;);
        }
        return;
    }
    
    if (taskToDelete) {
        // 添加移除动画
        taskToDelete.style.transform = &#39;scale(0.95)&#39;;
        taskToDelete.style.opacity = &#39;0&#39;;
        setTimeout(() => {
            taskToDelete.remove();
            renumberTasks();
        }, 300);
    }
}

function handleSavePlan() {
    // 在实际应用中，这里会收集表单所有数据并进行验证
    console.log(&#39;保存计划...&#39;);
    
    // 显示操作成功的提示
    if(window.showToast) {
        showToast(&#39;学习计划已保存&#39;, &#39;success&#39;);
    }
    
    // 延迟导航，给用户看toast的时间
    setTimeout(() => {
        navigateTo(&#39;study_plan_detail_page&#39;);
    }, 1500);
}
</script>
  

<script>
    setTimeout(() => {
      Holder.run({
        domain: "placehold.co"
      })
    }, 100)
  </script></body></html>'></iframe>
                    </div>
                  </div>

                </body>
                </html>
            